<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    import="paket.*"
    import= "java.util.*"%>
    
    <%  
   	MainModel model = (MainModel) session.getAttribute("MainModel");
	if(model==null){
	model = new MainModel();
	session.setAttribute("MainModel", model);
	}
	%>
    
    <% 
    String anvnamn = request.getParameter("anvnamn");
    String losenord =  request.getParameter("losenord");
    String namn =  request.getParameter("namn");
    String adress =  request.getParameter("adress");
    String mail =  request.getParameter("mail");
    String id =  request.getParameter("id");
    
    String action =  request.getParameter("action");
    
    if(action.equals("new")||action.equals("update")){
    	model.updateUserUI(anvnamn, losenord, namn, adress, mail, id, action);
    }
    else if(action.equals("delete")){
    	model.deleteUserUI(id);
    }
    response.sendRedirect("index.jsp?sida=admin");
    %>
    